package PlanetDefender;

import phonegame.GamePlayer;
import phonegame.IAlarmListener;
 
public class Mine extends Building implements IAlarmListener{ 

	private int production;
	private int speed;
	
	public Mine(String name, int price, int health, int x, int y, int speed, int production, GamePlayer player) {
		super(name,price, health,x, y);
		this.speed = speed;
		this.production = production;		
	}
	
	public void produce() {
		player.increase(production);
		setTimer(speed, 0 , this);		
	}
	
	public void alarm(int id) {
		if (id == 0 ) {
			this.produce();
		}		
	}
}
